package org.example.service.impl;

import java.util.List;

import org.example.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.mapper.UtuFollowerMapper;
import org.example.domain.UtuFollower;
import org.example.service.IUtuFollowerService;

/**
 * 被关注Service业务层处理
 * 
 * @author coderfun
 * @date 2024-12-04
 */
@Service
public class UtuFollowerServiceImpl implements IUtuFollowerService 
{
    @Autowired
    private UtuFollowerMapper utuFollowerMapper;

    /**
     * 查询被关注
     * 
     * @param id 被关注主键
     * @return 被关注
     */
    @Override
    public UtuFollower selectUtuFollowerById(Long id)
    {
        return utuFollowerMapper.selectUtuFollowerById(id);
    }

    /**
     * 查询被关注列表
     * 
     * @param utuFollower 被关注
     * @return 被关注
     */
    @Override
    public List<UtuFollower> selectUtuFollowerList(UtuFollower utuFollower)
    {
        return utuFollowerMapper.selectUtuFollowerList(utuFollower);
    }

    /**
     * 新增被关注
     * 
     * @param utuFollower 被关注
     * @return 结果
     */
    @Override
    public int insertUtuFollower(UtuFollower utuFollower)
    {
        utuFollower.setUpdateTime(DateUtils.getNowDate());
        return utuFollowerMapper.insertUtuFollower(utuFollower);
    }

    /**
     * 修改被关注
     * 
     * @param utuFollower 被关注
     * @return 结果
     */
    @Override
    public int updateUtuFollower(UtuFollower utuFollower)
    {
        utuFollower.setUpdateTime(DateUtils.getNowDate());
        return utuFollowerMapper.updateUtuFollower(utuFollower);
    }

    /**
     * 批量删除被关注
     * 
     * @param ids 需要删除的被关注主键
     * @return 结果
     */
    @Override
    public int deleteUtuFollowerByIds(Long[] ids)
    {
        return utuFollowerMapper.deleteUtuFollowerByIds(ids);
    }

    /**
     * 删除被关注信息
     * 
     * @param id 被关注主键
     * @return 结果
     */
    @Override
    public int deleteUtuFollowerById(Long id)
    {
        return utuFollowerMapper.deleteUtuFollowerById(id);
    }

    @Override
    public List<UtuFollower> selectFlowerList(UtuFollower utuFollower) {
        return utuFollowerMapper.selectFlowerList(utuFollower);
    }
}
